﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using DAO;
using System.Data;

namespace BUS
{
    public class BenhNhanBUS
    {
        public static bool InsertBenhNhan(BenhNhanDTO benhnhan)
        {            
            //du lieu ok
            BenhNhanDAO.InsertBenhNhan(benhnhan);
            return true;
        }
        public static bool InsertDotDieuTri(int mabn, DateTime ngay)
        {
            BenhNhanDAO.InsertDotDieuTri(mabn, ngay);
            return true;
        }
        public static bool InsertUpdateChiTietDieuTri(ChiTietDieuTriDTO ct)
        {
            return BenhNhanDAO.InsertUpdateChiTietDieuTri(ct);
        }
        public static bool InsertUpdateBenhNhan_Rang(int mabn, string rang, int mat, int trangthai, string thongtin)
        {
            return BenhNhanDAO.InsertUpdateBenhNhan_Rang(mabn, rang, mat, trangthai, thongtin);
        }
        public static bool InsertBenhNhan_BenhTienSu(int mabn, int mabts, string ghichu)
        {
            return BenhNhanDAO.InsertBenhNhan_BenhTienSu(mabn, mabts, ghichu);
        }
        public static bool InsertUpdateBenhNhan_BenhTienSu(int mabn, int mabts, string ghichu)
        {
            return BenhNhanDAO.InsertUpdateBenhNhan_BenhTienSu(mabn, mabts, ghichu);
        }

        public static bool UpdateBenhNhan(BenhNhanDTO benhnhan)
        {
            BenhNhanDAO.UpdateBenhNhan(benhnhan);
            return true;
        }
        public static bool UpdateDotDieuTri(DieuTriDTO dt)
        {
            return BenhNhanDAO.UpdateDotDieuTri(dt);
        }

        public static bool DeleteBenhNhan(BenhNhanDTO benhnhan)
        {
            BenhNhanDAO.DeleteBenhNhan(benhnhan);
            return true;
        }
        public static bool DeleteDotDieuTri(int ma)
        {
            return BenhNhanDAO.DeleteDotDieuTri(ma);
        }
        public static bool DeleteChiTietDieuTri(int maddt, int ma)
        {
            return BenhNhanDAO.DeleteChiTietDieuTri(maddt,ma);       
        }
        public static bool DeleteBenhNhan_BenhTienSu(int mabn, int mabts)
        {
            return BenhNhanDAO.DeleteBenhNhan_BenhTienSu(mabn, mabts);
        }
        public static bool DeleteBenhNhan_Rang(int mabn, string rang, int mat)
        {
            return BenhNhanDAO.DeleteBenhNhan_Rang(mabn, rang, mat);
        }

        public static int GetMaxMa()
        {
            return BenhNhanDAO.GetMaxMa();
        }

        public static List<BenhNhanDTO> SelectBenhNhanByAll()
        {
            return BenhNhanDAO.SelectBenhNhanByAll();
        }                
        public static List<BenhNhanDTO> SelectBenhNhanByHoTen(string hoten)
        {
            return BenhNhanDAO.SelectBenhNhanByHoTen(hoten);
        }
        public static List<BenhNhanDTO> SelectBenhNhanByThongTin(BenhNhanDTO bn)
        {
            return BenhNhanDAO.SelectBenhNhanByThongTin(bn);
        }
        public static DataTable SelectChiTietDieuTriByDotDieuTri(int maddt)
        {
            return BenhNhanDAO.SelectChiTietDieuTriByDotDieuTri(maddt);
        }
        public static DataTable SelectChiTietDieuTriByBenhNhan(int mabn)
        {
            return BenhNhanDAO.SelectChiTietDieuTriByBenhNhan(mabn);
        }
        public static BenhNhanDTO SelectBenhNhanByMa(int ma)
        {
            return BenhNhanDAO.SelectBenhNhanByMa(ma);
        }
        public static DieuTriDTO SelectDotDieuTriByMa(int ma)
        {
            return BenhNhanDAO.SelectDotDieuTriByMa(ma);
        }
        public static ChiTietDieuTriDTO SelectChiTietDieuTriByMa(int ma, int maddt)
        {
            return BenhNhanDAO.SelectChiTietDieuTriByMa(ma, maddt);
        }
        public static List<RangDTO> SelectAllTTRByMaBN(int mabn)
        {
            return BenhNhanDAO.SelectAllTTRByMaBN(mabn);
        }
        public static List<BenhTienSuDTO> SelectBenhNhan_BenhTienSuByMaBN(int mabn)
        {
            return BenhNhanDAO.SelectBenhNhan_BenhTienSuByMaBN(mabn);
        }
    }
}
